#include <sys/types.h>
#include <sys/param.h>
#include <sys/mount.h>

#include <err.h>
#include <stdio.h>
#include <string.h>
#include <time.h>

int
main(int argc, char *argv[])
{
   if (argc == 2) {
      /*
      char buffer[BUFSIZ];
      struct statfs buf;
      memset(&buf, 0, sizeof(struct statfs));
      memset(buffer, '\0', BUFSIZ);

      if (statfs(argv[1], &buf))
         err(1, "statfs");

      */

      int count = 0;
      int ix = 0;
      struct statfs *mntbuf;
      if ((count = getmntinfo(&mntbuf, 0)) == 0)
         err(1, "getmntinfo");
      
      for (ix = 0; ix < count; ix++) {
         printf("%s\n", ctime(&mntbuf[ix].f_ctime));
         printf("%d\n", mntbuf[ix].f_ctime);
         printf("%s\n", mntbuf[ix].f_fstypename);
         printf("%s\n", mntbuf[ix].f_mntonname);
         printf("%s\n", mntbuf[ix].f_mntfromname);
      }
   }

   return 0;
}

